#ifndef __MAINFORM_H__
#define __MAINFORM_H__

#include "ConfigRuleDlg.h"
#include "Executor.h"
#include <QtGui/QMainWindow>

class QTreeWidgetItem;
class QTreeWidget;
class QLineEdit;
namespace BatchRename
{
	class MainForm : public QMainWindow
	{
		Q_OBJECT
	public:
		MainForm(QWidget* parent = NULL);
		~MainForm(void);

		enum ListItemType
		{
			FileType,
			DirtoryType
		};

	private:
		void InitActions();
		void InitForms();
		void InitMenus(QMenuBar* menubar);
		void InitToolBar();

	private slots:
		void OpenFiles(bool);
		void OpenDirtory(bool);
		void Exit(bool);
		void MoveOnItem(bool);
		void MoveDownItem(bool);
		void DeleteItem(bool);
		void ConfigRule(bool);
		void ExcuteRule(bool);
		void LookLuaBook(bool);
		void About(bool);

	private:
		void AddFolder_Impl(QTreeWidgetItem* parentitem, QString dir);
		void ExcuteRule_Impl(QTreeWidgetItem* parentitem);

	private:
		QtAssemblyWidget::AssemblyTree		m_FileTree;
		QLineEdit*							m_RegLine;
		QLineEdit*							m_FileSuffixLine;

		QAction*							m_OpenFiles;
		QAction*							m_OpenDirtory;
		QAction*							m_Exit;

		QAction*							m_MoveOnItem;
		QAction*							m_MoveDownItem;
		QAction*							m_DeleteItem;

		QAction*							m_ConfigRule;
		QAction*							m_ExcuteRule;

		QAction*							m_LuaBook;
		QAction*							m_About;

	private:
		QVector<QString>					m_AboutContent;
		ConfigRuleDlg						m_ConfigRuleDlg;
		Executor							m_ExecuteConfig;
	};
}
#endif